<!DOCTYPE html>
<html>
  <head>
    <link type='text/css' rel='stylesheet' href='/static/jquery-ui-1.8.21.custom.css' />
    <link rel='stylesheet' href='/static/ui.multiselect.css' type='text/css'>
    <script src='/static/jquery-1.7.2.min.js'></script>
    <script src='/static/jquery-ui-1.8.21.custom.min.js'></script>
    <script src='/static/ui.multiselect.js'></script>
    <script src='/static/rdm_tests.js'></script>
    <title>RDM Tests</title>
    <style type='text/css'>
      body {
        margin: 0px;
        padding: 0px;
        font-family: sans-serif;
        font-size: 13px;
      }

      table {
        font-family: sans-serif;
        font-size: 13px;
        padding: 0px;
        margin: 0px;
        border: 0px;
        border-spacing: 0px;
      }

      input { border: #e4e9fe 1px solid; }

      fieldset {
        border: #67a7e3 1px solid;
        margin: 0px;
        margin-bottom: 5px;
      }

      legend {
        font-weight: bold;
      }

      ul {
        padding-left: 20px;
        margin: 0px;
      }

      #header {
        margin: 0px;
        padding: 0px;
        padding-bottom: 10px;
        left: 0px;
        text-align: left;
      }

      #header img {
        vertical-align: bottom;
      }

      #main-title {
        font-weight: bold;
        font-size: 18px;
      }

      #top-right {
        font-size: 13px;
        position: absolute;
        right: 0px;
        margin-top: 5px;
        margin-right: 10px;
        text-align: right;
      }

      #footer {
        padding-top: 5px;
        text-align: center;
        clear: both;
        font-size: 11px;
      }

      a {
        text-decoration: none;
        color: #0545ff;
      }

      a:visited {
        text-decoration: none;
        color: #0545ff;
      }

      a:hover {
        text-decoration: underline;
      }

      .external {
        background: url(/static/images/external.png) center right no-repeat;
        padding-right: 13px;
      }

      .stats_by_catg {
        float: right;
        text-align: left;
        font-weight: bold;
        font-size: 13px;
      }

      .rdm-tests-selection-multiselect {
          width: 680px;
          height: 200px;
      }

      .test-state-passed {
        color: #0CAB1E;
      }

      .test-state-failed {
        color: #FA021F;
      }

      .test-state-broken {
        color: #707070;
      }

      .test-state-not_run {
        color: #2E2B2B;
      }

      #rdm-tests-dmx_options {
        display: none;
      }

      #rdm-tests-notification {
        text-align: center;
      }

      #rdm-tests-results {
        display: none;
        width: 100%;
        z-index: 1000;
        background-color: #FFF;
      }

      #rdm-tests-results-stats {
        width: 400px;
        text-align: center;
        margin: 0px auto;
      }

      #rdm-tests-results-stats-table {
        border: 1.0px dashed #67a7e3;
        margin: 0px auto;
        margin-top: 10px;
      }

      #rdm-tests-results-stats-table td {
        padding: 5px;
        text-align: center;
        font-weight: bold;
      }

      .rdm-tests-select {
        background-color: #fff;
        border: 1.0px solid #67a7e3;
      }

      .results_container {
        margin: 0px auto;
        width: 80%;
      }

      .results_container_border {
        border: 1.0px solid #67a7e3;
        margin: 0px auto;
        width: 80%;
      }

      .ola-expander legend {
        cursor: pointer;
      }

      .ola-expander div {
        display: none;
      }

      .ola-expander-collapsed {
        display: inline-block;
        background-position: -48px -208px;
        width: 16px;
        height: 16px;
        background-image: url(images/ui-icons_70b2e1_256x240.png);
      }

      .ola-expander-expanded {
        display: inline-block;
        width: 16px;
        height: 16px;
        background-image: url(images/ui-icons_70b2e1_256x240.png);
        background-position: -64px -208px;
      }

      #rdm-tests-results-list {
        margin-left: 20px;
        margin-bottom: 20px;
        border: 0px;
        border-top: 1.0px solid #67a7e3;
        border-bottom: 1.0px solid #67a7e3;
        background-color: #fff;
        width: 100%;
        margin: 0px auto;
        height: 200px;
      }

      #rdm-tests-results-list option {
        margin: 2px;
        font-family: Trebuchet MS, Helvetica, Arial, sans-serif;
        font-size: 14px;
        font-weight: bold;
        background-color: #f8f8f8;
      }

      #rdm-tests-results-info {
        padding-top: 10px;
        height: 250px;
      }

      #rdm-tests-results-info-title {
        text-align: center;
        font-size: 14px;
        font-weight: bold;
      }

      #rdm-tests-results-info-doc {
        text-align: center;
        font-style: italic;
        font-size: 14px;
        padding-bottom: 10px;
      }

      #rdm-tests-results-info-state {
        font-weight: bold;
      }

      #rdm-tests-results-info-catg {
        font-weight: bold;
      }

      #rdm-tests-results-info-debug {
        white-space: pre;
        font-family: monospace;
        height: 150px;
        width: 100%;
        overflow: auto;
      }

      .button-container {
        padding-top: 10px;
        text-align: center;
      }

      #rdm-discovery-button {
        vertical-align: middle;
        padding: 5px;
      }

      #publisher-output {
        border: 1px solid #999999;
        height:400px;
        overflow: auto;
      }

      .ui-progressbar-value {
        background: #67A7E3;
      }

      .ui-tabs {
        background: #ffffff;
        border: 0px;
        padding: 0px;
      }
      .ui-tabs-nav {
        border: 0px;
        border-bottom: 1px solid #67a7e3;
        background: #ffffff;
      }
      .ui-tabs-panel {
        font-family: sans-serif;
        font-size: 13px;
        padding: 10px;
        border-bottom: 1px solid #67a7e3;
      }

      .no-close .ui-dialog-titlebar-close {display: none }
    </style>
  </head>
  <body>
    <div id='header'>
      <div id='title'>
        <img src='/static/images/logo.png' width='111' height='48' alt='Logo'>
        <span id='main-title'>RDM Responder Tests &amp; Publisher</span>
        <span id='top-right'>
          <a href='http://www.opendmx.net/index.php/Using_the_RDM_Test_UI' class='external' target='_blank'>Help</a>
        </span>
      </div>
    </div>
    <div id='tabs'>
     <ul>
      <li><a href='#tabs-1'>RDM Responder Tests</a></li>
      <li><a href='#tabs-2'>RDM Responder Publisher</a></li>
     </ul>
     <div id='tabs-1'>
      <div id='tests_control_frame'>
       <fieldset>
        <legend>Select the RDM device to test</legend>
         Universe: <select id='universe_options'></select>, RDM Responder:
         <select id='devices_list'></select>
          <a href='#'><img id='rdm-discovery-button' alt='Run Discovery' src='/static/images/discovery.png' title='Run Full Discovery' /></a>
       </fieldset>
       <fieldset>
         <legend>RDM Options</legend>
          Delay after sending broadcast SETs

          <input id='write_delay' maxlength='16' size='4' value='0'> milliseconds
       </fieldset>
       <fieldset>
        <legend>DMX512 Options</legend>
         <div>
           <input type='checkbox' id='rdm-tests-send_dmx_in_bg'>
             <label for='rdm-tests-send_dmx_in_bg'>Send DMX in background</label>
         </div>
         <table id='rdm-tests-dmx_options'>
          <tr>
           <td>DMX Frame rate (frames / second)
            <input id='dmx_frame_rate' maxlength='16' size='4' value='20'></td>
          </tr>
          <tr>
           <td>Number of Slots to Send
            <input id='slot_count' maxlength='3' size='4' value='128'></td>
          </tr>
         </table>
       </fieldset>
       <fieldset>
        <legend>Select Tests to Perform</legend>
        <form id='rdm-tests-selection'>
         <table>
          <tr>
           <td>
             <input type='radio' name='rdm-tests-selection' id='rdm-tests-selection-subset' class='rdm-tests-selection' checked='checked' />
             <label for='rdm-tests-selection-subset'>Select Tests</label>
           </td>
           <td>
             <select id='rdm-tests-selection-tests_list' class='rdm-tests-selection-multiselect' multiple='multiple' name='subset_test_defs'>
             </select>
           </td>
          </tr>
          <tr>
           <td>
             <input type='radio' name='rdm-tests-selection' id='rdm-tests-selection-previously_failed' class='rdm-tests-selection'/>
             <label for='rdm-tests-selection-previously_failed'>Failed Tests</label>
           </td>
           <td>
             <select id='rdm-tests-selection-failed_tests' class='rdm-tests-selection-multiselect' multiple='multiple' name='failed_test_defs'>
             </select>
           </td>
          </tr>
         </table>
        </form>
       </fieldset>
       <div class='button-container'>
         Running tests will modify the settings for responders connected to this universe. Think twice about doing this on a production system.
         <br/>
         <button id='rdm-tests-selection-run_tests'>Run Tests</button>
       </div>
      </div>
      <div id='rdm-tests-results'>
       <div id='rdm-tests-results-stats'>
        Test results for: <span style='font-weight: bold' id='rdm-tests-results-uid'></span>,
        generated in <span id='rdm-tests-results-duration'></span>.

        <table id='rdm-tests-results-stats-table'>
         <tr>
          <td class='test-state-broken'>Broken</td>
          <td class='test-state-failed'>Failed</td>
          <td class='test-state-not_run'>Not Run</td>
          <td class='test-state-passed'>Passed</td>
          <td style='color: #000'>Total</td>
         </tr>
         <tr id='rdm-tests-results-stats-figures'></tr>
        </table>
       </div>
       <div id='rdm-tests-results-summary-by_catg' class='results_container'>
        <fieldset class='ola-expander'>
          <legend>
           <span class='ola-expander-collapsed'></span>Results By Category
          </legend>
          <div>
           <ul id='rdm-tests-results-summary-by_catg-content'></ul>
          </div>
        </fieldset>
       </div>
       <div id='rdm-tests-results-warnings' class='results_container'>
        <fieldset class='ola-expander'>
         <legend>
           <span class='ola-expander-collapsed'></span>Warnings (<span id='rdm-tests-results-warning-count'></span>)
         </legend>
         <div>
          <ul id='rdm-tests-results-warnings-content'></ul>
         </div>
        </fieldset>
       </div>
       <div id='rdm-tests-results-advisories' class='results_container'>
        <fieldset class='ola-expander'>
         <legend>
          <span class='ola-expander-collapsed'></span>Advisories (<span id='rdm-tests-results-advisory-count'></span>)
         </legend>
         <div>
          <ul id='rdm-tests-results-advisories-content'></ul>
         </div>
        </fieldset>
       </div>
       <div class='results_container_border'>
         <div style='padding: 5px'>
           Test Category
           <select id='rdm-tests-results-summary-filter-by_catg' class='rdm-tests-select'>
           </select>,
           Result:
           <select id='rdm-tests-results-summary-filter-by_state' class='rdm-tests-select'>
             <option>All</option>
             <option>Passed</option>
             <option>Failed</option>
             <option>Broken</option>
             <option>Not Run</option>
           </select>
         </div>
         <select id='rdm-tests-results-list' size='10'></select>
         <div id='rdm-tests-results-info'>
           <div id='rdm-tests-results-info-title'></div>
           <div id='rdm-tests-results-info-doc'></div>
           <div style='padding-left: 10px'>
             Category: <span id='rdm-tests-results-info-catg'></span><br/>
             Result: <span id='rdm-tests-results-info-state'></span><br/>
             Debug Output:
           </div>
           <div id='rdm-tests-results-info-debug'></div>
         </div>
       </div>
       <div class='results_container button-container'>
        <button id='rdm-tests-results-button-dismiss'>Dismiss</button>
        <button id='rdm-tests-results-button-run_again'>Run Again</button>
        <button id='rdm-tests-results-button-save-options'>Download Results</button>
       </div>
      </div>
     </div>
     <div id='tabs-2'>
       <p>
        The RDM publisher can be used to publish a responder on the
        <a href='http://rdm.openlighting.org/' class='external' target='_blank'>rdm.openlighting.org</a>
        site. After collecting the responder information, you will
        have an opportunity to review the data before publishing.
       </p>

       <fieldset>
        <legend>Collector Options</legend>
         Universe: <select id='publisher-universe-list'></select>
         <p>
          <input type='checkbox' id='publisher-skip-queued-messages'>
          <label for='publisher-skip-queued-messages'>Skip
          Queued Messages. Select this if the responder doesn't support queued
          messages correctly.</label>
          </p>
          <button id='publisher-collect-button'>Collect Responder Information</button>
       </fieldset>

       <fieldset>
        <legend>Output</legend>
        <pre id='publisher-output'></pre>

        <div class='button-container'>
         <button id='publisher-clear-button'>Clear Output</button>
         <button id='publisher-upload-button'>Publish</button>
        </div>
       </fieldset>
     </div>
    </div>
    <div id='footer'>
      OLA &copy; 2012 Ravindra Nath Kakarla, Simon Newton &amp; the
      <a href='http://www.openlighting.org' class='external' target='_blank'>Open Lighting Project</a><br>
    </div>
    <div id='rdm-tests-notification'></div>
    <div id='rdm-error-notification'>
      An error has occured: '<span id='error-message'></span>'
      <pre id='traceback'></pre>
      <p>Please report this bug so it can be fixed. Clicking 'Report Bug' will
      open a new window and prompt you to sign in with your Google account.
      Only the information you see here will be sent.</p>
    </div>
    <div id='rdm-tests-save-options'>
      Category: <select id='rdm-tests-save-catg' class='rdm-tests-select'></select><br/>
      Result: <select id='rdm-tests-save-state' class='rdm-tests-select'>
        <option>All</option>
        <option>Passed</option>
        <option>Failed</option>
        <option>Broken</option>
        <option>Not Run</option>
      </select><br/>
      <input type='checkbox' id='rdm-tests-include-debug' checked='checked'>Include Debug Output
      <br/>
      <input type='checkbox' id='rdm-tests-include-description' checked='checked'>Include Test Descriptions
    </div>
    <iframe id='rdm-tests-download' style='display: none'></iframe>
    <form id='publisher-upload-form' method='post' target='_blank' action='http://rdm.openlighting.org/incoming/model_data' display='none'>
      <input type='hidden' name='model_data' id='publisher_upload_data'>
    </form>
  </body>
</html>
